<template>
	<view class="goods-list">
		<ProductItem v-for="item in list" :product="item" :key="item.id"></ProductItem>
	</view>
</template>
<script setup>
import { http } from '@/utils/http'
import ProductItem from './productItem.vue'

const list = ref([])
const getData = async () => {
	let res = await http.get('/api/home/products', { pageNum: 1, pageSize: 10 })
	if (res.code == 200) {
		list.value = res.data.products
	}
}

getData()
</script>
<style lang="scss" scoped>
.goods-list {
	width: 710rpx;

	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16rpx;
}
</style>
